#include <stdio.h>

#define        MAX        48

int        getScore(char * s) ;

int main()
{
    char    input[MAX] ;
    int        score ;

    scanf("%s",input);
    score = getScore(input) ;
    printf("%d\n",score) ;

    return 0;
}

int        getScore(char * s)
{
    int score=0,i=0;
    while(s[i]!='\0')
    {
        if(s[i]=='W') score+=3;
        else if(s[i]=='D') score+=1;
        i++;
    }
    return score;
}